package com.liyy.platform.other.mytest;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class TestRegex
{
	public static void main(String [] args){
		Pattern p = Pattern.compile("...");//第一种方式，效率高，功能多而强大
		Matcher m = p.matcher("abc");
		System.out.println(m.matches());
		System.out.println("abc".matches("..."));//第二种方式，效率低，功能较简单
		System.out.println("_aa8".matches("\\w+"));
		System.out.println("8aa_".matches("\\w+"));
	}
}